// 导入依赖模块
yepjs.require("YBA.Data.ajax");

// 终端数据接口
yepjs.define("Statistics", {

    NS: "YBA.Data",

    field: {
        /*
         * 获取当前用户所属的客户的当天在线情况信息统计
         * @data {

         }
         */
        customerOnlineTimely: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/customer/online/timely",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取指定终端当天离线原因
         * @data {
         terminalId    终端编号    String    必填
         }
         */
        offlineReasonToday: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/offline_reason/today",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取指定客户的历史在线情况信息统计
         * @data {

         }
         */
        customerOnlineHistory: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/customer/online/history",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取指定终端的历史在线情况
         * @data {
         terminalId    终端编号    String    必填
         }
         */
        terminalOnlineHistory: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/terminal/online/history",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取当前终端的历史离线原因分析
         * @data {
            terminalId    终端编号    String    必填
         }
         */
        terminalOfflineReasonHistory: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/terminal/offline_reason/history",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取当前客户任务执行情况
         * @data {
            customerId    客户编号    String    必填
         }
         */
        taskExecute: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/task/execute",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取当前的终端历史执行数据源信息列表
         * @data {
         terminalId    终端编号    String    必填
         }
         */
        terminalDatasourceExecuteToday: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/terminal/datasource/execute/today",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取当前的终端历史执行数据源信息列表
         * @data {
         terminalId    终端编号    String    必填
         }
         */
        terminalDatasourceExecuteHistory: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/terminal/datasource/execute/history",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取当前客户的存储情况统计
         * @data {

         }
         */
        storage: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/storage",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取该终端存储容量分布情况
         * @data {
            terminalId    终端编号    String    必填
         }
         */
        storageTrends: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/storage/trends",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取当前客户的接口使用情况
         * @data {
            type    接口类别    String  有以下四个类别：但是现在还没有给类别取值 1.监测类 2.通讯引导类 3.业务类 4.授权类
         }
         */
        interfaceReport: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/interface",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 首页整体概况统计
         * @data {

         }
         */
        statisticsFirstPage: function(data, success, error) {
            YBA.Data.ajax({
                url: "/statistics/first_page",
                type:"GET",
                data: data,
                success: success,
                error: error
            });
        },
        /*
         * 获取用户操作日志列表
         * @data {

        }
         */
        getUserBehaviorsList: function(data, success, error) {
        	 YBA.Data.ajax({
                 url: "/userBeHaviorsLog/findByBackupLog",
                 data: data,
                 success: success,
                 error: error
             });
        }
    }
});
